//
//  STravel1TableViewCell.m
//  News
//
//  Created by dlios on 15-5-15.
//  Copyright (c) 2015年 PEAK. All rights reserved.
//

#import "STravel1TableViewCell.h"

@implementation STravel1TableViewCell
- (void)dealloc
{
    [_img1 release];
    [_img2 release];
    [_img3 release];
    [_lable release];
    [_cellImageView release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.cellImageView = [[UIImageView alloc] init];
//        _cellImageView.backgroundColor = [UIColor redColor];
        
        [self.contentView addSubview:_cellImageView];
        [_cellImageView release];

        
        self.img1 = [[UIImageView alloc] init];
//        _img1.backgroundColor  =[UIColor redColor];
        [self.contentView addSubview:_img1];
        [_img1 release];
        self.img2 = [[UIImageView alloc] init];
//        _img2.backgroundColor = [UIColor magentaColor];
        [self.contentView addSubview:_img2];
        [_img2 release];
        self.img3 = [[UIImageView alloc] init];
//        _img3.backgroundColor  =[UIColor blueColor];
        [self.contentView addSubview:_img3];
        [_img3 release];
        self.lable = [[UILabel alloc] init];
//        _lable.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_lable];
        [_lable release];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
//     _cellImageView.frame =self.contentView.bounds;
    
    _lable.frame = CGRectMake(10, 5, [UIScreen mainScreen].bounds.size.width / 1.03, 15);
    
    _img1.frame = CGRectMake(10, 30, [UIScreen mainScreen].bounds.size.width / 3.4 , [UIScreen mainScreen].bounds.size.height / 9.5);
    
    _img2.frame  =CGRectMake([UIScreen mainScreen].bounds.size.width / 2.88, 30,[UIScreen mainScreen].bounds.size.width / 3.4, [UIScreen mainScreen].bounds.size.height / 9.5);
    
    _img3.frame = CGRectMake([UIScreen mainScreen].bounds.size.width / 1.5, 30, self.img2.frame.size.width  , [UIScreen mainScreen].bounds.size.height / 9.5);
//
}
-(void)setSTravelTwo:(STravelObject *)STravelTwo
{
    if (_STravelTwo != STravelTwo) {
        [_STravelTwo release];
        _STravelTwo = [STravelTwo retain];
    }


    
    [_img1 sd_setImageWithURL:[NSURL URLWithString:STravelTwo.imgsrc]placeholderImage:[UIImage imageNamed:@"``_3(NZ4U{L@4L7FN0J70DA"]];
     
    NSString *s =  [STravelTwo.imgextra[0]objectForKey:@"imgsrc"];
   [_img2 sd_setImageWithURL:[NSURL URLWithString:s]placeholderImage:[UIImage imageNamed:@"``_3(NZ4U{L@4L7FN0J70DA"]];
   
    
    NSString *s1 =  [STravelTwo.imgextra[1]objectForKey:@"imgsrc"];
 
    [_img3 sd_setImageWithURL:[NSURL URLWithString:s1]placeholderImage:[UIImage imageNamed:@"``_3(NZ4U{L@4L7FN0J70DA"]];
 
    
//    [_img2 sd_setImageWithURL:[NSURL URLWithString:STravelTwo.imgextra]];
    
    _lable.text  = STravelTwo.title;
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
